package fr.enssat.tpcloud.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Représente les messages notifies
 * @author spotrin
 *
 */
@Entity
@Table( name = "tNotif")
public class Notif {
	
	/**
	 * Cle primaire
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	@Column(name = "idNotif")
	private int id;
    
    /**
     * Le message notifie
     */
    @JoinColumn(name = "idPost", referencedColumnName = "idPost")
    @ManyToOne(optional = false)
    private Post post;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Post getPost() {
		return post;
	}

	public void setPost(Post post) {
		this.post = post;
	}

}
